<?php
$title = 'Asociación de Usuarios con Perfiles';
$this->headTitle($title);
?>
<h1><?php echo $this->escapeHtml($title); ?></h1>
<?php
$form = $this->form;
$form->setAttribute('action', $this->url('us_pf'));
$form->prepare();
echo $this->form()->openTag($form);
?>

<br><br>
<table align="right">
<tr>
   <td><?php echo $this->formRow($form->get('nombre')); ?></td>
</tr>
<tr>
   </td><td><?php echo $this->formRow($form->get('apellido')); ?></td>
</tr>
<tr>
   <td align="right"><?php echo $this->formSubmit($form->get('submit')); ?></td>
</tr>
</table>

<table border=2 width=800>
<tr>
   <th>Nombre</th>
   <th>Apellido</th>
   <th>Mail</th>
   <th>Alumno</th>
   <th>Profesor</th>
   <th>Funcionario</th>
   <th>&nbsp;</th>
</tr>
<?php foreach ($usuarios as $usuario) : ?>
<tr>
   <td><?php echo $this->escapeHtml($usuario->nombre);?></td>
   <td><?php echo $this->escapeHtml($usuario->apellido);?></td>
   <td align="center"><?php echo $this->escapeHtml($usuario->mail);?></td>

   <td align="center"><input type="checkbox" disabled="disabled" name="user_type" value="Alumno" <?php if (!is_null($usuario->matricula)) echo "checked";?>></td>  
   <td align="center"><input type="checkbox" disabled="disabled" name="user_type" value="Profesor" <?php if (!is_null($usuario->id_profesor)) echo "checked";?>></td>
   <td align="center"><input type="checkbox" disabled="disabled" name="user_type" value="Funcionario" <?php if (!is_null($usuario->id_funcionario)) echo "checked"; ?>></td>
  
   <td align="center">
      <a href="<?php echo $this->url('us_pf',
              array('action'=>'asociar', 'id' => $usuario->id));?>">Editar Perfil</a>

   </td>
</tr>
<?php endforeach; ?>
</table>

<br><br><br>
<br><a href="/roles"><- atras</a>
